package com.cynteka.cyfoman.ui;

import java.util.Comparator;

/**
 * User: Sergey
 * Date: 27.07.11
 * Time: 12:01
 */
public class GridComparator implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        if (o1.getClass() == o2.getClass() && o1 instanceof Comparable) {
            return ((Comparable) o1).compareTo(o2);
        }

        return compare(String.valueOf(o1), String.valueOf(o2));

    }
}
